package com.moinut.studentattendancemanager.model.dao.proxy;

import com.moinut.studentattendancemanager.model.dao.ITeacherInfoDAO;
import com.moinut.studentattendancemanager.model.dao.impl.TeacherInfoDAOImpl;
import com.moinut.studentattendancemanager.model.vo.TeacherInfo;

import java.util.List;

/**
 * @author MOILING
 */
public class TeacherInfoDAOProxy extends BaseDAOProxy<TeacherInfoDAOImpl> implements ITeacherInfoDAO {

    @Override
    TeacherInfoDAOImpl setDAOImpl() {
        return new TeacherInfoDAOImpl(this.databaseConnection.getConnection());
    }

    @Override
    public List<TeacherInfo> getTeachersInfoByStudentId(String studentId) throws Exception {
        List<TeacherInfo> teachersInfo = this.dao.getTeachersInfoByStudentId(studentId);
        this.databaseConnection.close();
        return teachersInfo;
    }

    @Override
    public List<TeacherInfo> getAllTeachersInfo() throws Exception {
        List<TeacherInfo> teachersInfo = this.dao.getAllTeachersInfo();
        this.databaseConnection.close();
        return teachersInfo;
    }
}
